<?php
namespace app\before\validate;

use think\Validate;

class NeedApply extends Validate
{
    protected $rule = [
        'apply_user' => 'require|number',
        'need_type' => 'require',
        'foreign_key' => 'require|number',
        'price' => 'require|number',
        'order_no' => 'require',
        'tran_no' => 'require',
        'status' => 'require',
        'pay_type' => 'require',
        'pay_time' => 'require|number',
        'apply_time' => 'require|number',
    ];
    protected $message = [
        'apply_user.require' => '申请人ID为必填项',
        'apply_user.number' => '申请人ID需为数字',
        'need_type.require' => '需求类型 1：有偿 2：无偿为必填项',
        'foreign_key.require' => '需求ID为必填项',
        'foreign_key.number' => '需求ID需为数字',
        'price.require' => '收益金额为必填项',
        'price.number' => '收益金额需为数字',
        'order_no.require' => '订单编号为必填项',
        'tran_no.require' => '交易号为必填项',
        'status.require' => '状态  0：待付款  1：已付款为必填项',
        'pay_type.require' => '支付方式  0：余额支付  1：微信支付  2：支付宝为必填项',
        'pay_time.require' => '支付时间为必填项',
        'pay_time.number' => '支付时间需为数字',
        'apply_time.require' => '申请时间为必填项',
        'apply_time.number' => '申请时间需为数字',
    ];
    protected $scene = [
        'edit' => [
            'apply_user',
            'need_type',
            'foreign_key',
            'price',
            'order_no',
            'tran_no',
            'status',
            'pay_type',
            'pay_time',
            'apply_time',
        ],
    ];
}
